package main

import (
	"biliPushServer/global"
	"biliPushServer/initialize"
	"fmt"
	"net/http"
	"time"
)

// @title biliPushServer
// @version 1.0
// @description 哔哩哔哩动画后台API
// @termsOfService https://q9no1.com/login

// @contact.name fjiabinc
// @contact.url http://en.fjiabinc.top:7500
// @contact.email fjiabinc@qq.com

// @license.name go-gin
// @license.url https://github.com/gin-gonic/gin

// @description This is a sample Server pets
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name token
// @BasePath
func main() {
	Router := initialize.InitRouter()
	s := &http.Server{
		Addr:              fmt.Sprintf("%s:%s", global.Config.Server.Address, global.Config.Server.Port),
		Handler:           Router,
		TLSConfig:         nil,
		ReadTimeout:       10 * time.Second,
		ReadHeaderTimeout: 5 * time.Second,
		WriteTimeout:      10 * time.Minute,
		MaxHeaderBytes:    1 << 20,
	}
	fmt.Printf(`欢迎使用 JoinAdmin
	默认自动化文档地址:http://%s/swagger/index.html
	默认前端文件运行地址:http://%s
`, s.Addr, s.Addr)
	err := s.ListenAndServe()
	if err != nil {
		fmt.Println(err)
	}
}

